<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>jQuery.isFunction(obj)</title>
<link type="text/css" rel="stylesheet" href="style/style.css" tppabs="http://www.erdangjiade.com/manual/jquery/jquery/style/style.css"  />
</head>
<body id="split">
<div id="content">
  
  <div rel="jQuery.isFunction">
    <h2><span>返回值:Boolean</span>jQuery.isFunction(obj)</h2>
    <h3>概述</h3>
    <div class="desc">
      <p>测试对象是否为函数。</p>
      <div class="longdesc">
        <p><strong>注意：</strong>jQuery 1.3以后，在IE浏览器里，浏览器提供的函数比如'alert'还有 DOM 元素的方法比如 'getAttribute' 将不认为是函数</p>
      </div>
    </div>
    <h3>参数</h3>
    <div>
      <h4><strong>obj</strong><span>Object</span><em>V1.2</em></h4>
      <p>用于测试是否为函数的对象</p>
    </div>
    <div class="example">
      <h3>示例</h3>
      <span id="f_ad2"></span>
      <h4>描述:</h4>
      <p>检测是否为函数</p>
      <h5>jQuery 代码:</h5>
      <pre><code>function stub() {
    }
var objs = [
            function () {},
            { x:15, y:20 },
            null,
            stub,
            "function"
          ];
        jQuery.each(objs, function (i) {
        var isFunc = jQuery.isFunction(objs[i]);
        $("span:eq( " + i + ")").text(isFunc);
      });</code></pre>
      <h5>结果:</h5>
      <pre><code>[ true,false,false,true,false ]</code></pre>
    </div>
  </div>
</div>
</body>
</html>
<div style="display:none">

<script type="text/javascript">
var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3F327b016d332d3a7e4043796cab725707' type='text/javascript'%3E%3C/script%3E"));
</script>
</div>5